package sy.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.log4j.Logger;

import sy.dao.SysProjectDaoI;
import sy.model.SysProject;
import sy.service.SysProjectServiceI;

@Service("sysProjectService")
public class SysProjectServiceImpl implements SysProjectServiceI {
	
	private static final Logger logger = Logger.getLogger(SysProject.class);
	private SysProjectDaoI sysProjectDao;


	public SysProjectDaoI getSysProjectDao() {
		return sysProjectDao;
	}

	@Autowired
	public void setSysProjectDao(SysProjectDaoI sysProjectDao) {
		this.sysProjectDao = sysProjectDao;
	}

	@Override
	public Serializable save(SysProject sysProject) {
		
		return sysProjectDao.save(sysProject);
	}

	@Override
	public void remove(String[] ids) {
		// TODO Auto-generated method stub
		for (int i = 0; i < ids.length; i++) {
			SysProject sysProject =	sysProjectDao.getSysProjectById(ids[i]);
			sysProjectDao.remove(sysProject);
		}
	}

	/* (non-Javadoc)
	 * @see sy.service.SysProjectServiceI#update(sy.model.SysProject)
	 */
	@Override
	public void update(SysProject sysProject) {
		// TODO Auto-generated method stub
		sysProjectDao.update(sysProject);
	}

	/* (non-Javadoc)
	 * @see sy.service.SysProjectServiceI#list()
	 */
	@Override
	public List<SysProject> list() {
		// TODO Auto-generated method stub
		return sysProjectDao.list();
	}

	/* (non-Javadoc)
	 * @see sy.service.SysProjectServiceI#getSysProjectById(java.lang.String)
	 */
	@Override
	public SysProject getSysProjectById(String id) {
		// TODO Auto-generated method stub
		return sysProjectDao.getSysProjectById(id);
	}

	/* (non-Javadoc)
	 * @see sy.service.SysProjectServiceI#listSysProjectByKey(java.lang.String)
	 */
	@Override
	public List<SysProject> listSysProjectByKey(String key) {
		// TODO Auto-generated method stub
		return sysProjectDao.listSysProjectByKey(key);
	}



}
